package com.cbd.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cbd.pojo.PageBean;
import com.cbd.service.CompanycarportService;

@Controller
public class CompanycarportController {
	
	@Resource(name="companycarportServiceImpl")
	private CompanycarportService companycarportService;
	
	@RequestMapping(path="findAllCompanycarPort",method=RequestMethod.POST)
	public @ResponseBody PageBean findAllCompanycarPort(HttpServletRequest req){
		String needPage = req.getParameter("needPage");
		String companyId = req.getParameter("compID");
		PageBean pageBean = companycarportService.findAllCarPort(Integer.parseInt(needPage),Integer.parseInt(companyId));
		return pageBean;
	}
	
	@RequestMapping(path="findCompanyUsefulCarPort",method=RequestMethod.POST)
	public @ResponseBody PageBean findCompanyUsefulCarPort(HttpServletRequest req){
		String needPagei = req.getParameter("needPagei");
		String companyIdi = req.getParameter("compIDi");
		PageBean pageBean = companycarportService.findUsableCarPort(Integer.parseInt(needPagei),Integer.parseInt(companyIdi));
		return pageBean;
	} 
}
